package com.sdx.console.evaluation.service;

import java.util.List;

import com.ibeetl.admin.core.entity.BaseEntity;
import org.beetl.sql.core.engine.PageQuery;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ibeetl.admin.core.util.PlatformException;

import com.sdx.console.evaluation.dao.CpTaskDataDao;
import com.sdx.console.evaluation.entity.CpTaskData;
import com.ibeetl.admin.core.service.BaseService;

/**
 * CpTaskData Service
 */

@Service
@Transactional
public class CpTaskDataService extends BaseService<CpTaskData>{

    @Resource
	private CpTaskDataDao cpTaskDataDao;

    public PageQuery<CpTaskData>queryByCondition(PageQuery query){
        PageQuery ret =  cpTaskDataDao.queryByCondition(query);
        queryListAfter(ret.getList());
        return ret;
    }

    public void batchDelCpTaskData(List<String> ids){
        try {
            cpTaskDataDao.batchDelCpTaskDataByIds(ids);
        } catch (Exception e) {
            throw new PlatformException("批量删除CpTaskData失败", e);
        }
    }

    public void  delDataByTaskId(Integer taskId){
        cpTaskDataDao.delDataByTaskId(taskId);
    }

	public List<CpTaskData> all() {
		return cpTaskDataDao.all();
		}

    public List<CpTaskData> selectCpTaskData(Integer taskId) {
        return cpTaskDataDao.selectCpTaskData( taskId);
    }

    public List<CpTaskData> selectExportData(Integer taskId) {
        return cpTaskDataDao.selectExportData( taskId);
    }
}